package com.ws.q1.service.lmpl;

import com.ws.q1.bean.HouTai;
import com.ws.q1.bean.User;
import com.ws.q1.mapper.HoutaiMapper;
import com.ws.q1.service.HoutaiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Houtailmpl implements HoutaiService {
    @Autowired
    HoutaiMapper houtaiMapper;
    @Override
    public HouTai houtailogin(String name, String pass) {
        return houtaiMapper.houtailogin(name,pass);
    }

    @Override
    public boolean isUsernameExists(String name) {
        return houtaiMapper.isUsernameExists(name) > 0;
    }

    @Override
    public int add(String name, String pass, String tou) {
        return houtaiMapper.add(name,pass,tou);
    }

    @Override
    public List<HouTai> getUsersByName(String name) {
        return houtaiMapper.getUsersByName(name);
    }

    @Override
    public List<HouTai> getAllUsers() {
        return houtaiMapper.getAllUsers();
    }

    @Override
    public int deleteById(Integer id) {
        houtaiMapper.deleteById(id);
        return 1;
    }

    @Override
    public HouTai huixian(Integer id) {
        return houtaiMapper.huixian(id);
    }

    @Override
    public void update(Integer id, HouTai houtai) {
        houtaiMapper.update(id,houtai);
    }


}
